package com.zuma.oci.docker.handler;

import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;

@Data
public class PushImageLinePrint {

    public static PushImageLinePrint build(String content) {
        var data = JSON.parseObject(content, PushImageLinePrint.class);
        data.setOriginalContent(content);
        return data;
    }

    private String id;

    private String stream;

    private String message;

    private String status;

    private String error;

    private String progress;

    private ProgressDetail progressDetail;




    @JSONField(serialize = false, deserialize = false)
    private String originalContent;

    @Override
    public String toString() {
        return originalContent;
    }


    @Data
    public static class ProgressDetail {
        private Long current;
        private Long total;
        private Long start;
    }
}
